import Vuex from "vuex";
import Vue from "vue";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    webSiteBigTitle:'某某后台管理系统',
    userInfo: {
      userName: ''
    },
    token: "",
    loading: false
  },
  mutations: {
    login(state, data) {
      localStorage.setItem("token", data);
      state.token = data;
    },
    logout(state) {
      localStorage.removeItem("token");
      state.token = "";
      state.user = {};
    }
  }
});
